import React from 'react'
import { Text } from 'react-native'
import PropTypes from 'prop-types'

export default function CustomTextEllipsize (props) {
  const { style, text, ellipsizeMode, numberOfLines } = props
  return (
    <Text
      style={style}
      numberOfLines={numberOfLines}
      ellipsizeMode={ellipsizeMode}>{text}</Text>
  )
}
CustomTextEllipsize.defaultProps = {
  ellipsizeMode: 'tail',
  numberOfLines: 1
}
CustomTextEllipsize.propTypes = {
  ellipsizeMode: PropTypes.string,
  numberOfLines: PropTypes.number,
  style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
  text: PropTypes.string
}
